import EvaluateService from "../service/EvaluateService";
// import EvaluateStore from "../store/EvaluateStore"
import { ElMessage } from 'element-plus';
export interface Evaluate{
    EvaluateList(callback:any):void;
    EvaluationQuery(courseName:string,limit:number,page:number,vipName:string,callback:any):void;
}
export function EvaluateHooks():Evaluate{
    // const store = EvaluateStore()
    function EvaluateList(callback:any) {
        EvaluateService.getAssessing().then((res:any)=>{  
         if(res.data.code==0){
         callback(res.data.data)
        
          }     
        })
    }
    function EvaluationQuery(courseName:string,limit:number,page:number,vipName:string,callback:any){
        EvaluateService.getEvaluationQuery(courseName,limit,page,vipName).then((res:any)=>{
            if(res.data.code==0){
                callback(res.data.data)
            }else{
                ElMessage(res.data.msg)
            }
        }).catch((err:any)=>{
            ElMessage.error("请求失败")
        })
    }
    return{
        EvaluateList,
        EvaluationQuery
    }
}